
#ifndef BOSECMD_AIDL_SERVICE_H
#define BOSECMD_AIDL_SERVICE_H

#include <BnBoseCmd.h>
#include <AudioMessager.h>
#include <vector>

#include <BoseAidlService.h>


typedef int (*CommandProcessorFuncType)(const char * cmdStr, char* const response, int);

typedef struct {
    CommandProcessorFuncType callSystemFunc;
    CommandProcessorFuncType callPopenFunc;
}BoseAidlServiceCallbacks;

namespace com {

namespace bose {
class BoseAidlService : public com::bose::BnBoseCmd {

friend class AudioMessager;

public:
	  BoseAidlService(BoseAidlServiceCallbacks* cb){
         __android_log_print(ANDROID_LOG_INFO, "BoseAidlService", "Contructor");
         mCallbacks.callSystemFunc = cb->callSystemFunc;
         mCallbacks.callPopenFunc = cb->callPopenFunc;
         mAm = new AudioMessager();
    }
	  ~BoseAidlService();
    BoseAidlService();
    virtual ::android::binder::Status CallSystem(const ::android::String16& cmd, int32_t* _aidl_return);
    virtual ::android::binder::Status CallPopen(const ::android::String16& cmd, ::std::vector<int32_t>* errorCodes, ::std::vector<uint8_t>* _aidl_return);
    virtual ::android::binder::Status SendMessage(const ::std::vector<uint8_t>& message, int32_t* _aidl_return);
    virtual ::android::binder::Status GetMessage(const ::std::vector<uint8_t>& message, ::std::vector<int32_t>* errorCodes,
                                                ::std::vector<uint8_t>* _aidl_return);

protected:
    AudioMessager* mAm;

private:
    BoseAidlServiceCallbacks mCallbacks;
};

}  // namespace bose

}  // namespace com

#endif
 